import request from "../request.js"

function findAllAddress(){
	return request({
		url:`/lejuClient/address/findAllAddress`,
		method:"get"
	})
}

//更新收货地址
function updateAddressInfo(data){
	return request({
		url:`/lejuClient/address/updateAddressInfo`,
		method:"post",
		data
	})
}

//删除收货地址
function delAddressInfo(id){
	return request({
		url:`/lejuClient/address/delAddressInfo/${id}`,
		method:"DELETE"
	})
}

//切换默认状态
function switchDefault(addressId,defaultStatus){
	return request({
		url:`/lejuClient/address/switchDefault/${addressId}/${defaultStatus}`,
		method:"post"
	})
}
export{findAllAddress,updateAddressInfo,delAddressInfo,switchDefault}